<?php 
class LoginController extends Controller{
	public function __init(){

	}

	//后台登录
	public function login(){
		if(IS_POST){
			$db=K('Login');
			if($db->login()){
				go('Index/index');//go('Admin/Index/index');
			}else{
				$this->error($db->error);
			}
		}else{
			$this->display();
		}
	}

	//调用验证码
	public function code(){
		$code=new Code();
		$code->show();
	}

	//退出登录
	public function out(){
		unset($_SESSION['user']);
		go('login');
	}
}//登录控制器类结束